# -*- coding: utf-8 -*-

import sip
sip.setapi('QString', 2)
sip.setapi('QStringList', 2)
sip.setapi('QVariant', 2)

from PyQt4 import QtGui

#_______________________________________________________________________________
class SongLabelView(QtGui.QLabel):
    
    def __init__(self, parent):
        QtGui.QLabel.__init__(self, parent)
        title_format = "<font size=5>%s</font>"
        artist_format = "<br>by <em><font size=3>%s</font></em> "
        album_format = "from <em><font size=3>%s</font></em></br>"
        year_format = "<br><em><font size=3>%s</font></em></br>"
        self.text_format = [title_format, artist_format, album_format, year_format]
        self.setText("<font size=5>Il Client non &egrave; Connesso</font>")
        self.default_text = title_format % "Niente In Riproduzione"
    
#    def set_controller(self, ctrl):
#        self.ctrl = ctrl

    def set_model(self, model):
        self.model = model
        
#    def reset_label(self):
#        text = self.default_text 
#        self.setText(text.decode("utf-8"))
#
#    def update_label(self, data=None):
#        if data == None:
#            self.reset_label()
#        else:
#            if isinstance(data, tuple):
#                text = []
#                for i in xrange(len(data)):
#                    item = self.text_format[i] % str(data[i])
#                    text.append(item.decode("utf-8"))
#                text = "".join(text)
#                self.setText(text)